package com.pigdogbay.androidutils.mvp;

public class BackgroundColorPresenter {

	private IBackgroundColorModel _Model;
	private IBackgroundColorView _View;
	
	public void setView(IBackgroundColorView view)
	{
		_View = view;
	}
	public void setModel(IBackgroundColorModel model)
	{
		_Model = model;
	}
	public BackgroundColorPresenter()
	{
	}
	public BackgroundColorPresenter(IBackgroundColorView view,IBackgroundColorModel model)
	{
		_View = view;
		_Model = model;
	}

	public void updateLockedBackground()
	{
		int bgId = _Model.getDefaultBackgroundId();
		if (_Model.getUnlockColorPack())
		{
			bgId = _Model.getBackgroundId();
		}
		_View.setBackgroundColor(bgId);
	}
	public void updateBackground()
	{
		int bgId = _Model.getBackgroundId();
		_View.setBackgroundColor(bgId);
	}
	/**
	 * Allows the user to change the background setting before buying the colour unlock purchase 
	 */
	public void trialUpdateBackground()
	{
		int bgId = _Model.getBackgroundId();
		_View.setBackgroundColor(bgId);
		if (!_Model.getUnlockColorPack())
		{
			_View.showPurchaseRequiredWarning();
		}
	}
	
}
